package util;

import java.util.ArrayList;
import java.util.Date;

import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

public class Test {

	/**
	 *@author qingyu zhang
	 *@function:
	 * @param args
	 *2011-2-21
	 *下午12:03:26
	 *webservice
	 *util
	 *void
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try {
			ArrayList list = new Test().getN();
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public ArrayList getN() throws ServiceException, Exception{
		System.out.println("访问");
		String strName = "http://218.201.155.112:8088/smsInfac/services/webServer?wsdl";
		ArrayList list = new ArrayList();
		Service service = new Service();
		Call call = (Call) service.createCall();
		QName qn = new QName("urn:webServer","ArrayList");
		call.setTargetEndpointAddress(new java.net.URL(strName));
		call.setOperationName(new QName("webServer","retureLogo"));
		call.addParameter("DB_IP", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("DB_NAME", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("DB_PASS", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("MAS_NAME", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("MAS_PASS", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("STARTDATE", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("ENDDATE", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("ORGADD", XMLType.XSD_STRING, ParameterMode.IN);
		call.addParameter("PHONE", XMLType.XSD_STRING, ParameterMode.IN);
		call.setReturnClass(ArrayList.class);
			
		list = (ArrayList)call.invoke(new Object[]{"218.201.155.112","CustomSMS","SqlMsde@InfoxEie2000","admin","y4yhl9t","2011-03-13 17:51:07","2011-04-14 17:51:08","1065731601050000","15854132785"});
		System.out.println("返回!!");
		if(list!=null&&list.size()>0){
			for(int i = 0;i<list.size();i++){
				System.out.println("返回的值"+list.get(i));
			}
		}else {
			System.out.println("无相应记录");
		}
		return list;
	}
	/**
	 *@author qingyu zhang
	 *@function:
	 *2011-2-21
	 *下午12:03:26
	 *webservice
	 *util
	 */
}
